package com.zsk.shop.enums;

//校验检查验证码
public enum EnumCheckCode {
    YES("手机号与验证码校验通过", 1),
    CODE_ERROR("验证码校验不正确", 2),
    NULL_PHONE("没有该手机号的注册信息", 4);

    String name;
    Integer code;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    EnumCheckCode(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static String getNameByCode(Integer code) {
        EnumCheckCode[] enums = EnumCheckCode.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getName();
            }
        }
        return "";
    }

}
